/*
 * Route.hpp
 *
 *  Created on: Dec 22, 2014
 *      Author: wasp
 */

#ifndef ROUTE_HPP_
#define ROUTE_HPP_

#include <QObject>

class QTimer;

namespace de
{
namespace heimweghelden
{
namespace security
{
class Session;
}
namespace location
{

class Route: public QObject { Q_OBJECT
public:
    Route(QObject* parent, double latS, double lonS, double latE, double lonE);
    ~Route();
    void updatePosition(double lat, double lon);
    int updateHelden(QString number, bool active);
    void updateEstimatedDuration(int seconds);
    void start();
    void checkState();
    double lonStart;
    double latStart;
    double lonEnd;
    double latEnd;
    double lonCurrent;
    double latCurrent;
    int secondsRemaining;
    int estimatedDuration;
    QTimer* homecomingtimer;
    QList<QString>* helden;
    de::heimweghelden::security::Session *session;
    signals:
        void onPositionUpdated(double lat, double lon);
        void onTimeExpired();
        void onTimeLapsed(int estimatedDuration);
        void exceeded(int warnlevel, int seconds, double lat, double lon);
        void arrived();
        void routeStarted();
public Q_SLOTS:
        void decreaseTime();
private:
    double distanceStraight;
};

} /* namespace location */
} /* namespace heimweghelden */
} /* namespace de */

#endif /* ROUTE_HPP_ */
